package edu.ut.ece382c.valloy.parser;

import java.util.HashMap;
import java.util.Set;

public class TempClassMap {

	private HashMap<String,ValloyClass> classMap;
	private Module model;
	public TempClassMap(Module model) {
		this.classMap = new HashMap<String,ValloyClass> ();
		this.model = model;
	}

	public boolean add (String name, String parent){
		if (classMap.containsKey(name)){
			return false;
		}
		else {
			ValloyClass tempParent = null;
			if (parent != "" && parent!= null){
				tempParent = new ValloyClass(parent,null);
			}
			classMap.put(name, new ValloyClass(name,tempParent));
			return true;
		}
	}
	
	public Set<String> returnAll (){
		return classMap.keySet();
	}
	
	public boolean contains(String name) {
		return classMap.containsKey(name);
	}
	
	public ValloyClass get(String name){
		if (classMap.containsKey(name)){
			return classMap.get(name);
		}
		else 
			return null;
	}
}
